
<div
	id="main_menu">
<ul>
	<li class="m <?php echo $this->uri->segment(1) == '' ? 'selected' : ''?>"><a href="<?php echo site_url()?>">Trang chủ</a></li>
	
    <?php 
    for ($i = 0; $i < count($categories); $i++) {
    	$item = $categories[$i];
    	echo '<li class="m ' . $item->selected . '"><a href="'. site_url($item->link_rewrite). '" rel="' .$item->link_rewrite.'">'.$item->cname.'</a>';
    	if (isset($item->scategories)){
    		echo '<ul id="'.$item->link_rewrite.'" class="sub_menu">';
    		
    		for ($j = 0; $j < count($item->scategories); $j++){
    			$sitem = $item->scategories[$j];
    			echo '<li><a href="'.site_url($item->link_rewrite . '/'. $sitem->link_rewrite).'">'.$sitem->scname.'</a></li>';
    		}
    		
    		echo '</ul>';
    	}
    	
    	echo '</li>';
    }
    ?>
	<li class="m"><a href="javascript:void(0);" class="last">Sitemap</a></li>
</ul>

<!-- If you want to make it even simpler, you can append these html using jquery -->
<div id="box">
<div class="head"></div>
</div>

</div>
<div class="submenu">
<div id="search_box">
<form action="<?php echo site_url('search')?>" id="frmsearch" name="frmsearch" method="post">
<input type="text" id="keyword" name="keyword"  placeholder="Nhập nội dung tìm kiếm vào đây"/>
<a href="javascript:void(0);" onclick="$('#frmsearch').submit();" id="search_btn"><em>Tìm</em></a>

</form>
 </div>
</div>
